const dataArr = 20;
const dataX = 100;
const height1 = { value: 600 };
export default {
  option: {
    title: [
      {
        text:
          '{val|' + 20 + '}\n{name|' + 'CNC-1' + '}',
        bottom: '12%',
        left: 'center',
        textStyle: {
          rich: {
            val: {
              fontSize: '20',
              color: '#E5E5E5',
              padding: [10, 0],
            },
            name: {
              fontSize: '16',
              color: '#E5E5E5',
            },
            unit: {
              fontSize: '14',
              color: '#DCCC5F',
            },
          },
        },
        triggerEvent: true,
      },
    ],
    legend: { show: false, },
    series: [
      {
        name: '最外部进度条',
        type: 'gauge',
        radius: '100%',
        splitNumber: 10,
        axisLine: {
          lineStyle: {
            color: [
              [
                dataArr / dataX,
                {
                  type: 'linear',
                  x: 0,
                  y: 1,
                  x2: 0.5,
                  y2: 0.5,
                  colorStops: [
                    {  offset: 0, color: 'rgba(0,0,0,0)', },
                    { offset: 0.8, color: '#583043', },
                    { offset: 1, color: '#C34743',  },
                  ],
                  global: false, // 缺省为 false
                },
              ],
              [1, '#083158'],
            ],
            width: 5,
          },
        },
        axisLabel: {show: false,},
        axisTick: {show: false,},
        splitLine: {show: false,},
        itemStyle: {show: false,},
        detail: {show: false,},
        title: {show: false,},
        data: [
          {
            name: 'title',
            value: dataArr,
          },
        ],
        pointer: {show: false,},
        animationDuration: 4000,
      },

      {
        name: '刻度尺',
        type: 'gauge',
        radius: '94%',
        splitNumber: 6, // 刻度数量
        min: 0, // 最小刻度
        max: dataX, // 最大刻度
        // 仪表盘轴线相关配置
        axisLine: {
          lineStyle: {
            color: [
              [
                1,
                {
                  type: 'radial',
                  x: 0.5,
                  y: 0.6,
                  r: 0.6,
                  colorStops: [
                    { offset: 0.85, color: '#031F46', },
                    {offset: 0.93, color: '#086989', },
                    { offset: 1,color: '#12D7EF',},
                  ],
                },
              ],
            ],
            width: 500,
          },
        },
        /** 分隔线样式*/
        splitLine: {
          show: true,
          length: 10,
          lineStyle: {
            width: 3,
            color: '#12E5FE', // 用颜色渐变函数不起作用
          },
        },
        /** 刻度线*/
        axisTick: {
          show: true,
          splitNumber: 20,
          lineStyle: {
            color: '#12E5FE', // 用颜色渐变函数不起作用
            width: 1,
          },
          length: 3,
        },
        /** 刻度标签*/
        axisLabel: {
          distance: 2,
          color: '#CEF3FE',
        },
        detail: {show: false,},
        animationDuration: 4000,
      },
      {
        name: '外部指针',
        type: 'gauge',
        radius: '98%',
        axisLine: {
          lineStyle: {
            color: [
              [dataArr / dataX - 0.001, 'rgba(0,0,0,0)'],
              [dataArr / dataX + 0.003, '#C34743'],
              [1, 'rgba(0,0,0,0)'],
            ],
            width: 33,
          },
        },
        axisLabel: {show: false,},
        axisTick: {show: false,},
        splitLine: {show: false,},
        itemStyle: {show: false,},
        detail: {show: false,},
        title: {show: false,},
        data: [
          {
            name: 'title',
            value: dataArr,
          },
        ],
        pointer: {show: false,},
        animationDuration: 4000,
      },
      {
        name: '内层带指针',
        type: 'gauge',
        radius: '56%',
        splitNumber: 10, // 刻度数量
        min: 0, // 最小刻度
        max: dataX, // 最大刻度
        // 仪表盘轴线相关配置
        axisLine: {
          lineStyle: {
            color: [
              [1, {
                type: 'radial',
                x: 0.5, y: 0.59, r: 0.6,
                colorStops: [
                  { offset: 0.72, color: '#032046', },
                  { offset: 0.94, color: '#086989', },
                  { offset: 0.98, color: '#0FAFCB', },
                  { offset: 1, color: '#0EA4C1', },
                ],
              }],
            ],
            width: 1000,
          },
        },
        /** 分隔线样式*/
        splitLine: {
          show: false,
        },
        /** 刻度线*/
        axisTick: {
          show: false,
        },
        /** 刻度标签*/
        axisLabel: {
          show: false,
        },
        /** 仪表盘指针*/
        pointer: {
          show: true,
          length: '95%',
          width: 5, // 指针粗细
        },
        /** 仪表盘指针样式*/
        itemStyle: {
          color: '#12E5FF',
        },
        data: [
          {
            value: dataArr,
          },
        ],
        detail: {
          show: false,
        },
      },
    ]
  }
}
